var templateParams = {
    tableTheads:["节点名称", "IP", "用户名", "最大线程","当前执行线程", "状态", "工作目录", "创建时间", "创建人"
        , "备注","操作"]
};

var columnsSetting = [
    {
        "data":null,
        "render":function(data, type, full, meta){
            return checkboxHmtl(data.slave_name, data.id, "selectSlave");
        }},
    {
        "data": "slave_name",
        "width": "18%"
    },
    ellipsisData("ip"),
    ellipsisData("username"),
    {"data": "parallel_max"},
    {"data": "parallel_now"},
    {"data": "status"},
    ellipsisData("work_path"),
    ellipsisData("create_time"),
    ellipsisData("creator_name"),
    longTextData("mark", "slave_name", "备注信息"),
    {
        "data":null,
        "render":function(data, type, full, meta){
            var context = [{
                title:"选择",
                markClass:"object-choose",
                iconFont:"&#xe6ab;"
            }];
            return btnIconTemplate(context);
        }
    }];

var eventList = {
    '.object-choose':function(){
        choosedCallBackFun(table.row( $(this).parents('tr') ).data());
        parent.layer.close(parent.layer.getFrameIndex(window.name));
    }
};
var choosedCallBackFun;//成功选择之后的回调函数
var mySetting = {
    eventList:eventList,
    templateCallBack:function(df){
        choosedCallBackFun = parent[GetQueryString("callback")];
        df.resolve();
    },
    listPage:{
        listUrl:REQUEST_URL.WEB_EXECUTION_MACHINE.listAcceptMachine,
        tableObj:".table-sort",
        columnsSetting:columnsSetting,
        columnsJson:[0, 11],
        dtOtherSetting:{serverSide:false},
        exportExcel:false,
    },
    templateParams:templateParams
};

$(function(){
    publish.renderParams = $.extend(true,publish.renderParams,mySetting);
    publish.init();
});
